fix(mobile): paginate agent sessions list and clear the tab bar overlay#4380
Merged
Conversation
The sessions SectionList had no bottom padding for the absolutely-positioned tab bar, so the last rows were stuck underneath it and the list bounced back when scrolling down. Content now pads by the tab bar overlay height. Stored sessions were also fetched with a hardcoded 5-day updatedSince window, so anything older was never loaded. The list now uses cursor-based infinite pagination (the cliSessionsV2.list procedure already supported it), loading 30 sessions per page via onEndReached with a footer spinner.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe prior search-pagination gap was resolved by switching session search to the server-side Files Reviewed (2 files)
Previous Review Summary (commit 9df7c0d)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9df7c0d)Status: 1 Issue Found | Recommendation: Address before merge Executive SummarySwitching stored-sessions to cursor pagination means client-side search only sees currently-loaded pages, with no mechanism to auto-fetch more while searching. Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Reviewed by claude-sonnet-5-20260630 · Input: 42 · Output: 8.5K · Cached: 1.2M Review guidance: REVIEW.md from base branch |
jeanduplessis
approved these changes
Jul 3, 2026
Client-side search only matched sessions from already-loaded pages now that the list is cursor-paginated. Wire the debounced search query to the cliSessionsV2.search endpoint instead, so search covers the full history. Active (remote) sessions keep the client-side match since they're a small in-memory list not covered by the search endpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported: "it won't let me scroll down to view past CLI sessions". Two separate causes:
Last rows hidden under the tab bar. The tab bar is an absolutely-positioned translucent overlay, and the sessions
SectionListhad no bottom content padding — every other scrollable screen pads bygetTabBarOverlayHeight, this one only did so for its empty state. Scrolling to the end left the final rows underneath the tab bar and the list bounced back.Sessions older than 5 days were never loaded.
useStoredSessionshardcodedupdatedSinceto 5 days ago with no pagination, so older sessions weren't below the fold — they weren't fetched at all (the "Older" date bucket was unreachable).Fix
SectionListcontent by the tab bar overlay height.useInfiniteQuery— thecliSessionsV2.listprocedure already supportscursor/nextCursor, so no backend changes. 30 sessions per page, loaded ononEndReachedwith a footer spinner, deduped bysession_idacross pages (a session updated mid-paging can repeat since the cursor isupdated_at).liveStoredSessions/offlineSessionsfields from the hook (no consumers).Testing
pnpm format && pnpm typecheck && pnpm lint && pnpm check:unusedclean;pnpm test360/360 passing.